<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <div @click="show('父')">
            父类
            <!-- .stop阻止冒泡 -->
            <div @click.stop="show('子')">
                子类
            </div>
        </div>
        <div @click.once="doThis('只能按一次')">只能按一次</div>
        
        <!-- prevent提交事件不再重载页面 -->
        <a @click.prevent="tj('百度')" href="https://baidu.com">百度</a>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <script>
        var mv=new Vue({
            el:"#app",
            data:{

            },
            methods:{
                show(n){
                    alert(n);
                },
                doThis(a){
                    alert(a)
                },
                tj(n){
                    console.log(n);
                }
            }
        })
    </script>
</body>
</html>